//
//  CIBNPlayTitleCell.m
//  CIBN
//
//  Created by ZNGOO on 16/7/20.
//  Copyright © 2016年 韦儒健. All rights reserved.
//

#import "CIBNPlayTitleCell.h"

@implementation CIBNPlayTitleCell

- (instancetype)initWithFrame:(CGRect)frame{
    self = [super initWithFrame:frame];
    if (self) {
        
        self.title_Director = [[UILabel alloc] initWithFrame:CGRectMake(10, 5, 0, 0)];
        self.title_Director.font = [UIFont systemFontOfSize:12];
        self.title_Director.textColor = [UIColor grayColor];
        [self addSubview:self.title_Director];
        
        self.title_Actor = [[UILabel alloc] initWithFrame:CGRectMake(10, CGRectGetMaxY(self.title_Director.frame) + 10, 0, 0)];
        self.title_Actor.font = [UIFont systemFontOfSize:12];
        self.title_Actor.textColor = [UIColor grayColor];
        [self addSubview:self.title_Actor];
        
        self.title_Storyplot = [[UILabel alloc] init];
        self.title_Storyplot.font = [UIFont systemFontOfSize:12];
        self.title_Storyplot.textColor = [UIColor grayColor];
        [self addSubview:self.title_Storyplot];
        
    }
    return self;
}

- (void)setCellModel:(CIBNPlayHomeModel *)model{
    
    self.title_Director.text = [NSString stringWithFormat:@"导演：%@", model.director];
    [self.title_Director sizeToFit];

    
    self.title_Actor.frame = CGRectMake(10, CGRectGetMaxY(self.title_Director.frame), 0, 0);
    self.title_Actor.text = [NSString stringWithFormat:@"演员：%@", model.actor];
    [self.title_Actor sizeToFit];
    
    
    
    CGFloat h = [ZJModelTool sizeWithText:model.storyplot font:[UIFont systemFontOfSize:14] width:ScreenWidth - 20];
    self.title_Storyplot.frame = CGRectMake(10, CGRectGetMaxY(self.title_Actor.frame), ScreenWidth - 20, h);
    self.title_Storyplot.text = model.storyplot;
    self.title_Storyplot.numberOfLines = 0;
}
@end
